//
//  HelpCenterViewController.m
//  Kjs-iOS
//
//  Created by Pat on 16/9/6.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "HelpCenterViewController.h"

@interface HelpCenterViewController ()
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *helpTitleBtns;
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation HelpCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = NO;
    for (UIButton * button in self.helpTitleBtns) {
        button.tag = [self.helpTitleBtns indexOfObject:button];
        [button addTarget:self action:@selector(btnPressed:) forControlEvents:UIControlEventTouchUpInside];
    }
    [self.helpTitleBtns[0] setSelected:YES];
    [self.webView loadHTMLString:self.briefIntro[0].content baseURL:nil];
    self.webView.backgroundColor = [UIColor whiteColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)btnPressed:(id)sender {
    for (UIButton * button in self.helpTitleBtns) {
        button.selected = NO;
    }
    ((UIButton *)sender).selected = YES;
    ((UIButton *)sender).backgroundColor = [UIColor clearColor];
    [self.webView loadHTMLString:self.briefIntro[((UIButton *)sender).tag].content baseURL:nil];
}

@end
